package com.synjones.wschool.face.serviceImpl;

import com.synjones.wschool.face.domain.FileStorage;
import com.synjones.wschool.face.mapper.FileStorageMapper;
import com.synjones.wschool.face.service.FileStorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * Created by 24398 on 2018/7/27.
 */
@Service
@Slf4j
public class FileStorageServiceImpl implements FileStorageService {
    @Resource
    private FileStorageMapper fileStorageMapper;

    @Override
    public List<FileStorage> selectList(List<Long> fileSourceObjIds, Integer sourceType) {
        if(fileSourceObjIds == null || fileSourceObjIds.isEmpty() ){
            return Collections.emptyList();
        }
        List<FileStorage> fileStorages = this.fileStorageMapper.findByIdListAndType(fileSourceObjIds,sourceType);
        return fileStorages;
    }
}
